﻿using System.Windows.Controls;
using System.Windows.Data;

using SBPweb.Messenger.Clients.Base;

namespace SBPweb.Messenger.ClientApplication.Controls
{

    public partial class MainWindow : UserControl
    {

        #region Private fields

        private IMessenger messenger;

        #endregion

        #region Constructor logic

        public MainWindow()
        {
            InitializeComponent();
        }
        
        #endregion

        #region Property accessors

        public IMessenger Messenger
        {
            get
            {
                return messenger;
            }
            set
            {
                messenger = value;
                InitializeBindings();
            }
        }

        #endregion

        #region Private helper functions

        private void InitializeBindings()
        {
            Binding binding = new Binding();
            binding.Source = Messenger.Connections;
            ucConnection.SetBinding(Connection.ConnectionManagerProperty, binding);
        }

        #endregion

    }

}
